<script lang="ts" setup>
import type { ComponentOptionsMixin } from 'vue'
import { computed, unref } from 'vue'

import { Button } from 'ant-design-vue'

import { useAttrs } from '@/hooks/core/useAttrs'
const props = defineProps({})
defineOptions({ name: 'AButton', extends: Button as ComponentOptionsMixin, indeterminate: false })
// get component class
const attrs = useAttrs({ excludeDefaultKeys: false })
// get inherit binding value
const getBindValue = computed(() => ({ ...unref(attrs), ...props }))
</script>

<template>
  <Button v-bind="getBindValue">
    <template #default="data">
      <slot v-bind="data || {}" />
    </template>
  </Button>
</template>
